//
//  MineAccountSecurityCell.m
//  ShowYork
//
//  Created by hxh on 2020/11/5.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "MineAccountSecurityCell.h"


@implementation MineAccountSecurityCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUI];
    }
    return self;
}
- (void)setUI{
    

    self.lineView = [[UIView alloc]init];
    self.lineView.backgroundColor = RGBA(230, 230, 230, 1);
    [self.contentView addSubview:self.lineView];
    
    self.titleLb = [[UILabel alloc]init];
    self.titleLb.font = font(14);
    self.titleLb.textColor = C51;
    [self.contentView addSubview:self.titleLb];
    
    [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self.contentView).offset(16);
        make.bottom.equalTo(self.contentView).offset(-16);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(16);
        make.bottom.equalTo(self.contentView);
        make.height.mas_equalTo(0.5);
        make.right.equalTo(self.contentView).offset(30);
    }];
}

+(instancetype)cellWithTableView:(UITableView *)tableView{
    NSString *ID = @"MineAccountSecurityCell";
    MineAccountSecurityCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[MineAccountSecurityCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    return cell;
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
    [super setHighlighted:highlighted animated:animated];
    //初始化为未选中状态
    if (highlighted == YES) {
        //做一些选中后的改变
        self.backgroundColor = RGBA(230, 230, 230, 1);
    }else{
        self.backgroundColor = [UIColor whiteColor];
    }
}

@end
